<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "nxh_location".
 *
 * @property integer $id
 * @property integer $category_id
 * @property integer $subcategory_id
 * @property string $name
 * @property string $description
 * @property string $address
 * @property string $city
 * @property string $phone
 * @property string $mobile
 * @property string $websitelink
 * @property double $latitude
 * @property double $longitude
 * @property string $note
 * @property integer $status_flg
 * @property integer $create_time
 * @property integer $update_time
 * @property integer $del_flg
 */
class Location extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'nxh_location';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['category_id', 'subcategory_id', 'latitude', 'longitude', 'create_time', 'update_time'], 'required'],
            [['category_id', 'subcategory_id', 'status_flg', 'create_time', 'update_time', 'del_flg'], 'integer'],
            [['description', 'note'], 'string'],
            [['latitude', 'longitude'], 'number'],
            [['name', 'address', 'city', 'phone', 'mobile', 'websitelink'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'category_id' => Yii::t('app', 'Category ID'),
            'subcategory_id' => Yii::t('app', 'Subcategory ID'),
            'name' => Yii::t('app', 'Name'),
            'description' => Yii::t('app', 'Description'),
            'address' => Yii::t('app', 'Address'),
            'city' => Yii::t('app', 'City'),
            'phone' => Yii::t('app', 'Phone'),
            'mobile' => Yii::t('app', 'Mobile'),
            'websitelink' => Yii::t('app', 'Websitelink'),
            'latitude' => Yii::t('app', 'Latitude'),
            'longitude' => Yii::t('app', 'Longitude'),
            'note' => Yii::t('app', 'Note'),
            'status_flg' => Yii::t('app', 'Status Flg'),
            'create_time' => Yii::t('app', 'Create Time'),
            'update_time' => Yii::t('app', 'Update Time'),
            'del_flg' => Yii::t('app', 'Del Flg'),
        ];
    }
}
